package Test;
import java.io.*;

import Course.course;
import People.student;
import People.teacher;

public class test {
    public static void main(String[] args) {

        student Z = new student(2021310839, "Z", "男");
        teacher LI = new teacher(1111, "LI", "男");
        course JAVA = new course(1, "JAVA", "教105", "周五10：00-12：00", "LI", 1);

        LI.addTeachCourse(JAVA);
        Z.chooseCourse(JAVA);
        Z.displayCourse();
        //测试主类
        try {
            ObjectOutputStream oos = new ObjectOutputStream(new FileOutputStream("experiment6"));
            oos.writeObject(Z);
            File f = new File("experiment6");
            ObjectInputStream ois = new ObjectInputStream(new FileInputStream(f));
            student newStudent1 = (student)ois.readObject();
            newStudent1.removeCourse(JAVA);
            System.out.println(newStudent1.toString());
        }
        catch (Exception e) {
            System.out.print("Error: " + e);
            System.exit(1);
        }
    }
}
